<?php 
/*************************************************************************************
 * showtrips.php
 * -----------
 * phpGMapTrips 
 * 
 * This php application allows you to easily record your travel destinations 
 * and display them with Google maps.
 * 
 * Author: Stephane Coste (lescoste@gmail.com)
 * Copyright: (c) 2006 Stephane Coste (http://lescoste.net/)
 * Release Version: 0.1
 * CVS Revision Version: $Revision: 1.10 $
 * Date Started: 2006/02/19
 * Last Modified: $Date: 2007/02/13 05:48:43 $
 *
 *************************************************************************************
 *
 *     This file is part of phpGMapTrips.
 *
 *   phpGMapTrips is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   phpGMapTrips is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with phpGMapTrips; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ************************************************************************************/
?>
<?php 
header("Content-type: text/xml");
/*
return all trips
*/
include_once("dbaccess.php");
$triparray = getTripSummary();

echo '<trips>';
foreach ($triparray as $tripname => $tripnb) {
	echo '<trip name="'.$tripname.'" size="'.$tripnb.'" g="f" ';
	if (!empty($db_tripNamearray[$tripname])){
		echo ' title="'.$db_tripNamearray[$tripname].'" ';
	}
	echo ' />';
	print "\n";
}
$groupsarray = getGroups();
foreach ($groupsarray as $groupname => $tripnames) {
	$groupsize = 0;
	foreach ($tripnames as $tripname) {
		$groupsize += $triparray[$tripname];
	}
	echo '<trip name="'.$groupname.'" size="'.$groupsize.'" g="t" />';
	print "\n";
}
echo '</trips>';
?>
